Skip to main content

Interface: PeerConnection

Hierarchy

Properties

answerOptions

answerOptions: undefined | RTCAnswerOptions

Inherited from

BasePeerConnection.answerOptions


bandwidth

bandwidth: Bandwidth

Inherited from

BasePeerConnection.bandwidth


close

close: () => void

Type declaration

▸ (): void

Returns

void

Inherited from

BasePeerConnection.close


configs

configs: MediaConfig[]

Inherited from

BasePeerConnection.configs


connectionState

connectionState: RTCPeerConnectionState

Inherited from

BasePeerConnection.connectionState


createDataChannel

createDataChannel: (label: string, dataChannelDict?: RTCDataChannelInit) => RTCDataChannel

Type declaration

▸ (label, dataChannelDict?): RTCDataChannel

Parameters
NameType
labelstring
dataChannelDict?RTCDataChannelInit
Returns

RTCDataChannel

Inherited from

BasePeerConnection.createDataChannel


currentLocalDescription

currentLocalDescription: null | RTCSessionDescription


currentRemoteDescription

currentRemoteDescription: null | RTCSessionDescription


getConfiguration

getConfiguration: () => RTCConfiguration

Type declaration

▸ (): RTCConfiguration

Returns

RTCConfiguration

Inherited from

BasePeerConnection.getConfiguration


getDataChannelConfigs

getDataChannelConfigs: () => DataChannelConfig[]

Type declaration

▸ (): DataChannelConfig[]

Returns

DataChannelConfig[]

Inherited from

BasePeerConnection.getDataChannelConfigs


getTransceiverConfigs

getTransceiverConfigs: () => TransceiverConfig[]

Type declaration

▸ (): TransceiverConfig[]

Returns

TransceiverConfig[]

Inherited from

BasePeerConnection.getTransceiverConfigs


hasICECandidates

hasICECandidates: boolean

Inherited from

BasePeerConnection.hasICECandidates


iceConnectionState

iceConnectionState: RTCIceConnectionState

Inherited from

BasePeerConnection.iceConnectionState


iceGatheringState

iceGatheringState: RTCIceGatheringState

Inherited from

BasePeerConnection.iceGatheringState


negotiationNeeded

negotiationNeeded: boolean


offerOptions

offerOptions: undefined | RTCOfferOptions

Inherited from

BasePeerConnection.offerOptions


onConnectionStateChange

Optional onConnectionStateChange: EventHandler


onDataChannel

Optional onDataChannel: null | (this: RTCPeerConnection, ev: RTCDataChannelEvent) => any


onIceCandidate

Optional onIceCandidate: OnIceCandidateHandler


onIceCandidateError

Optional onIceCandidateError: null | (this: RTCPeerConnection, ev: Event) => any


onIceConnectionStateChange

Optional onIceConnectionStateChange: EventHandler


onIceGatheringStateChange

Optional onIceGatheringStateChange: EventHandler


onNegotiationNeeded

Optional onNegotiationNeeded: OnNegotiationNeededHandler


onRemoteStreams

Optional onRemoteStreams: OnRemoteStreamsEventHandler


onSecureCheckCode

Optional onSecureCheckCode: OnSecureCheckCodeHandler


onSignalingStateChange

Optional onSignalingStateChange: EventHandler


onTrack

Optional onTrack: OnTrackEventHandler


onTransceiverChange

Optional onTransceiverChange: OnTransceiverChangeHandler


peer

peer: ExtendedRTCPeerConnection

Inherited from

BasePeerConnection.peer


pendingLocalDescription

Optional pendingLocalDescription: RTCSessionDescription | RTCSessionDescriptionInit

It represents a local description that is in the process of being negotiated plus any local candidates that have been generated by the ICE Agent since the offer or answer was created. If the RTCPeerConnection is in the stable state, the value is null.

https://w3c.github.io/webrtc-pc/#dom-peerconnection-pendinglocaldesc


pendingRemoteDescription

pendingRemoteDescription: null | RTCSessionDescription

It represents a remote description that is in the process of being negotiated, complete with any remote candidates that have been supplied via addIceCandidate() since the offer or answer was created. If the RTCPeerConnection is in the stable state, the value is null.

https://w3c.github.io/webrtc-pc/#dom-peerconnection-pendingremotedesc


polite

polite: boolean

Inherited from

BasePeerConnection.polite


receivers

receivers: RTCRtpReceiver[]

Inherited from

BasePeerConnection.receivers


references

references: References

Reference of any logical associations to the peer connection for logging

Inherited from

BasePeerConnection.references


restartIce

restartIce: () => void

Type declaration

▸ (): void

Returns

void

Inherited from

BasePeerConnection.restartIce


senders

senders: RTCRtpSender[]

Inherited from

BasePeerConnection.senders


setConfiguration

setConfiguration: undefined | (configuration?: RTCConfiguration) => void

Only recently supported on some browser: https://caniuse.com/?search=setconfiguration

Inherited from

BasePeerConnection.setConfiguration


signalingState

signalingState: RTCSignalingState

Inherited from

BasePeerConnection.signalingState

Methods

addConfig

addConfig(peer, initOrConfig): DataChannelConfig

Parameters

NameType
peerRTCPeerConnection
initOrConfigDataChannelConfig | DataChannelInit

Returns

DataChannelConfig

Inherited from

BasePeerConnection.addConfig

addConfig(peer, initOrConfig): TransceiverConfig

Parameters

NameType
peerRTCPeerConnection
initOrConfigTransceiverConfig | TransceiverInit

Returns

TransceiverConfig

Inherited from

BasePeerConnection.addConfig

addConfig(peer, initOrConfig): TransceiverConfig | DataChannelConfig

Parameters

NameType
peerRTCPeerConnection
initOrConfigTransceiverConfig | DataChannelConfig | DataChannelInit | TransceiverInit

Returns

TransceiverConfig | DataChannelConfig

Inherited from

BasePeerConnection.addConfig


createAnswer

createAnswer(options?): Promise<RTCSessionDescriptionInit>

Parameters

NameType
options?RTCAnswerOptions

Returns

Promise<RTCSessionDescriptionInit>


createOffer

createOffer(options?): Promise<RTCSessionDescriptionInit>

Parameters

NameType
options?RTCOfferOptions

Returns

Promise<RTCSessionDescriptionInit>


getStats

getStats(selector?): Promise<RTCStatsReport>

Parameters

NameType
selector?null | MediaStreamTrack

Returns

Promise<RTCStatsReport>

Inherited from

BasePeerConnection.getStats


negotiate

negotiate(): Promise<void>

Returns

Promise<void>


receiveAnswer

receiveAnswer(answer): Promise<void>

Parameters

NameType
answerRTCSessionDescriptionInit

Returns

Promise<void>


receiveIceCandidate

receiveIceCandidate(candidate): Promise<void>

Parameters

NameType
candidateRTCIceCandidate | RTCIceCandidateInit

Returns

Promise<void>


receiveOffer

receiveOffer(offer): Promise<void>

Parameters

NameType
offerRTCSessionDescriptionInit

Returns

Promise<void>


releaseLocalICECandidatesBuffer

releaseLocalICECandidatesBuffer(ignore): void

Parameters

NameType
ignoreboolean

Returns

void


setLocalStream

setLocalStream(stream, target, shouldSyncMedia?): Promise<void>

Parameters

NameType
streamundefined | MediaStream
targetTransceiverConfigDirectionTuple[]
shouldSyncMedia?boolean

Returns

Promise<void>

Inherited from

BasePeerConnection.setLocalStream


setReference

setReference(key, value): void

Key/Value pair for referencing logical associations for logging

Parameters

NameTypeDescription
keystringThe key for the reference
valuestringThe value for the reference

Returns

void

Inherited from

BasePeerConnection.setReference